package people;

import java.net.InetAddress;

/**
 * Package  people 
 * Project ChatSystemG2 - INSA 4INFOA1 - 2013/2014
 * 
 * User represents a general user of the chat system
 * It contains the following attributes:  
 *
 * @author Sergio Gonzalez - Marie-Charlotte Bideaud
 */

public class User {
	
	private UserType type;
	
	// Username of the user
	private String username;
	
	// IP address of the user
	private InetAddress iPAddr ;
	
	//Depending on the type, we can use these differents attributes
	
	//message write to send
	private String text ;
	
	//filename to send
	private String filename ;
	
	//whole path of the filename
	private String path ;
	
	//filesize to send
	private long filesize ;
	
	//When its a request anser, its value
	private boolean answer;

	/** 
	 * Constructor of the class User
	 * @param username : String
	 * @param type : UserType
	 */
	
	public User (String username, UserType type) {
		this.username = username ;
		this.iPAddr = null;
		this.type = type;
		this.text = "";
		this.filename = "";
		this.filesize = 0;
		this.answer = false;
	}

	/** 
	 * Getter of username
	 * @return username
	 */
	
	public String getUsername() {
		return username;
	}
    
	/** 
	 * Setter of username
	 * @param username
	 */
	
	public void setUsername(String username) {
		this.username = username;
	}
	
	/** 
	 * Getter of iPAddr
	 * @return iPAddr
	 */

	public InetAddress getIPAddr() {
		return iPAddr;
	}
	
	/** 
	 * Setter of iPAddr
	 * @param iPAddr
	 */

	public void setIPAddr(InetAddress iPAddr) {
		this.iPAddr = iPAddr;
	}
	
	/** 
	 * Getter of text
	 * @return text
	 */
	
	public String getText() {
		return text;
	}

	/** 
	 * Setter of text
	 * @param text : String
	 */
	
	public void setText(String text) {
		this.text = text;
	}
	
	/** 
	 * Getter of filename
	 * @return filename
	 */

	public String getFilename() {
		return filename;
	}

	/** 
	 * Setter of filename
	 * @param filename : String
	 */
	
	public void setFilename(String filename) {
		this.filename = filename;
	}
	
	/** 
	 * Getter of filesize
	 * @return filesize
	 */

	public long getFilesize() {
		return filesize;
	}

	/** 
	 * Setter of filesize
	 * @param filesize : long
	 */
	
	public void setFilesize(long filesize) {
		this.filesize = filesize;
	}
	
	/** 
	 * Getter of type
	 * @return type
	 */

	public UserType getType() {
		return type;
	}

	/** 
	 * Setter of type
	 * @param type : UserType
	 */
	
	public void setType(UserType type) {
		this.type = type;
	}
	
	/** 
	 * Getter of the boolean value of answer
	 * @return answer
	 */

	public boolean isAnswer() {
		return answer;
	}

	/** 
	 * Setter of answer
	 * @param answer : boolean
	 */
	
	public void setAnswer(boolean answer) {
		this.answer = answer;
	}
	
	/** 
	 * Getter of path
	 * @return path
	 */

	public String getPath() {
		return path;
	}
	
	/** 
	 * Setter of path
	 * @param path : String
	 */

	public void setPath(String path) {
		this.path = path;
	}
	
}
